package eu.opensepa.lab.ouranos.model;

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Embeddable
public class Settlement {

	public static Settlement newSettlement(Date sttlmtDt, Amount amt) {
		Settlement s = new Settlement();
		s.setSttlmtDt(sttlmtDt);
		s.setAmt(amt);
		return s;
	}
	
	@Basic(optional=false)
	@Column(name="STTLMT_DT")
	@Temporal(TemporalType.DATE)
	private Date sttlmtDt;
	
	@AttributeOverrides({
		@AttributeOverride(
			name="ccy",
			column=@Column(name="STTLMT_AMT_CCY", length=3)),
	    @AttributeOverride(
	    	name="val",
	    	column=@Column(name="STTLMT_AMT_VAL", precision=12, scale=2))})
	private Amount amt;
	
	public Date getSttlmtDt() {
		return sttlmtDt;
	}

	public Amount getAmt() {
		return amt;
	}

	public void setSttlmtDt(Date sttlmtDt) {
		this.sttlmtDt = sttlmtDt;
	}

	public void setAmt(Amount amt) {
		this.amt = amt;
	}
	
}